/**
 * 
 */
package de.cbf.cam.dsa.model.entities;

import javax.persistence.Entity;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

import de.cbf.cam.dsa.model.base.TalentTmpl;

/**
 * @author Nebelritter
 *
 */
@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public class WeaponTalent extends OneTalent {

	/**
	 * @uml.property  name="atDistribution"
	 */
	private Integer atDistribution = 0;
	/**
	 * @uml.property  name="paDistribution"
	 */
	private Integer paDistribution = 0;
	
	public static String PROPERTYNAME = "WeaponTalent:";	
	/**
	 * @param owner
	 * @param name
	 */
	public WeaponTalent(TalentTmpl template,OneNPC owner,int value) {
		super(template,owner,value);		
	}
	
	
	/**
	 * @return
	 * @uml.property  name="atDistribution"
	 */
	public Integer getAtDistribution() {
		return atDistribution;
	}
	/**
	 * @return
	 * @uml.property  name="paDistribution"
	 */
	public Integer getPaDistribution() {
		return paDistribution;
	}
	/**
	 * @param atDistribution
	 * @uml.property  name="atDistribution"
	 */
	public void setAtDistribution(Integer atDistribution) {
		this.atDistribution = atDistribution;
		propertyChangeSupport.firePropertyChange(PROPERTYNAME+"atDistribution",null, atDistribution);		
	}
	/**
	 * @param paDistribution
	 * @uml.property  name="paDistribution"
	 */
	public void setPaDistribution(Integer paDistribution) {
		this.paDistribution = paDistribution;
		propertyChangeSupport.firePropertyChange(PROPERTYNAME+"paDistribution",null, paDistribution);
	}


	@Override
	public WeaponTalent clone() {
		WeaponTalent weaponTalent = new WeaponTalent(template,owner,value);		
		weaponTalent.atDistribution=atDistribution;
		weaponTalent.paDistribution=paDistribution;
		return weaponTalent;
	}
	public WeaponTalent cloneForCharacter(OneNPC character){
		WeaponTalent talent = new WeaponTalent(template,character, value);		
		talent.atDistribution=atDistribution;
		talent.paDistribution=paDistribution;
		return talent;
	}

}
